package org.openwork.portlet.skillmanagement.service.http;

import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;

import org.openwork.portlet.skillmanagement.service.SkillServiceUtil;

import java.rmi.RemoteException;


/**
 * <a href="SkillServiceSoap.java.html"><b><i>View Source</i></b></a>
 *
 * <p>
 * ServiceBuilder generated this class. Modifications in this class will be
 * overwritten the next time is generated.
 * </p>
 *
 * <p>
 * This class provides a SOAP utility for the
 * {@link org.openwork.portlet.skillmanagement.service.SkillServiceUtil} service utility. The
 * static methods of this class calls the same methods of the service utility.
 * However, the signatures are different because it is difficult for SOAP to
 * support certain types.
 * </p>
 *
 * <p>
 * ServiceBuilder follows certain rules in translating the methods. For example,
 * if the method in the service utility returns a {@link java.util.List}, that
 * is translated to an array of {@link org.openwork.portlet.skillmanagement.model.SkillSoap}.
 * If the method in the service utility returns a
 * {@link org.openwork.portlet.skillmanagement.model.Skill}, that is translated to a
 * {@link org.openwork.portlet.skillmanagement.model.SkillSoap}. Methods that SOAP cannot
 * safely wire are skipped.
 * </p>
 *
 * <p>
 * The benefits of using the SOAP utility is that it is cross platform
 * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
 * even Perl, to call the generated services. One drawback of SOAP is that it is
 * slow because it needs to serialize all calls into a text format (XML).
 * </p>
 *
 * <p>
 * You can see a list of services at
 * http://localhost:8080/tunnel-web/secure/axis. Set the property
 * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
 * security.
 * </p>
 *
 * <p>
 * The SOAP utility is only generated for remote services.
 * </p>
 *
 * @author    Samuel Garcia Martinez
 * @see       SkillServiceHttp
 * @see       org.openwork.portlet.skillmanagement.model.SkillSoap
 * @see       org.openwork.portlet.skillmanagement.service.SkillServiceUtil
 * @generated
 */
public class SkillServiceSoap {
    private static Log _log = LogFactoryUtil.getLog(SkillServiceSoap.class);

    public static org.openwork.portlet.skillmanagement.model.SkillSoap updateSkill(
        long pk, java.lang.String name, long userId, long categoryId)
        throws RemoteException {
        try {
            org.openwork.portlet.skillmanagement.model.Skill returnValue = SkillServiceUtil.updateSkill(pk,
                    name, userId, categoryId);

            return org.openwork.portlet.skillmanagement.model.SkillSoap.toSoapModel(returnValue);
        } catch (Exception e) {
            _log.error(e, e);

            throw new RemoteException(e.getMessage());
        }
    }

    public static org.openwork.portlet.skillmanagement.model.SkillSoap addSkill(
        java.lang.String name, long userId, long categoryId)
        throws RemoteException {
        try {
            org.openwork.portlet.skillmanagement.model.Skill returnValue = SkillServiceUtil.addSkill(name,
                    userId, categoryId);

            return org.openwork.portlet.skillmanagement.model.SkillSoap.toSoapModel(returnValue);
        } catch (Exception e) {
            _log.error(e, e);

            throw new RemoteException(e.getMessage());
        }
    }

    public static int countByCategoryId(long categoryId)
        throws RemoteException {
        try {
            int returnValue = SkillServiceUtil.countByCategoryId(categoryId);

            return returnValue;
        } catch (Exception e) {
            _log.error(e, e);

            throw new RemoteException(e.getMessage());
        }
    }

    public static org.openwork.portlet.skillmanagement.model.SkillSoap[] searchByCategoryId(
        long categoryId, int start, int end,
        com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
        throws RemoteException {
        try {
            java.util.List<org.openwork.portlet.skillmanagement.model.Skill> returnValue =
                SkillServiceUtil.searchByCategoryId(categoryId, start, end,
                    orderByComparator);

            return org.openwork.portlet.skillmanagement.model.SkillSoap.toSoapModels(returnValue);
        } catch (Exception e) {
            _log.error(e, e);

            throw new RemoteException(e.getMessage());
        }
    }

    public static org.openwork.portlet.skillmanagement.model.SkillSoap[] searchByCategoryId(
        long categoryId) throws RemoteException {
        try {
            java.util.List<org.openwork.portlet.skillmanagement.model.Skill> returnValue =
                SkillServiceUtil.searchByCategoryId(categoryId);

            return org.openwork.portlet.skillmanagement.model.SkillSoap.toSoapModels(returnValue);
        } catch (Exception e) {
            _log.error(e, e);

            throw new RemoteException(e.getMessage());
        }
    }
}
